<?php
if(!defined('PATH')) exit();

$query = $query->fetchAll();
if (count($query) > 0) {
	$this->archez->showMsg('Currently <b>'.count($query).'</b> players are online on <b>'.$this->config['server']['name'].'</b>', 'info');
?>
<br/>
<table border="0" cellpadding="8" cellspacing="1" width="100%">
<tr class="head"><td width="5%"><b>#</b></td><td width="50%"><a href="<?=PATH?>/online/name/<?=$sort['name']?>"><b>Name <?=Helper_General::arrow_sorting_highscores($sort['name'], 'name')?></b></a></td><td width="20%"><a href="<?=PATH?>/online/level/<?=$sort['level']?>"><b>Level <?=Helper_General::arrow_sorting_highscores($sort['level'], 'level')?></b></a></td><td><a href="<?=PATH?>/online/vocation/<?=$sort['vocation']?>"><b>Vocation <?=Helper_General::arrow_sorting_highscores($sort['vocation'], 'vocation')?></b></a></td></tr>
<?php
	$i = 1;
	foreach ($query as $player) {
?>
<tr><td><?=$i?>.</td><td><a href="<?=PATH?>/search/check/<?=urlencode($player['name'])?>"><?=$player['name']?></a></td><td><?=$player['level']?></td><td><?=$this->config['server']['professions'][$player['promotion']][$player['vocation']]?></td></tr>
<?php
		$i++;
	}
?>
</table>
<?php
} else {
	$this->archez->showMsg('Currently no one is playing on <b>'.$this->config['server']['name'].'</b>.', 'notice');
}
?>